Using systemsetup
The command-line tool systemsetup is used to configure other nonnetwork system settings. You can use it to query or alter time zones, network time servers, sleep settings, Energy Saver preferences, Remote Login (SSH) preferences, and more. You will find the command-line syntax, explanations, and example in the tool's help prompt by entering the following line in the Terminal:
- /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/systemsetup -help
A few of the capabilities of systemsetup are listed below:
| Flag | Description |
|---|---|
| -setallowpowerbuttontosleepcomputer (on | off) | Enable or disable whether the power button can sleep the computer. Example:systemsetup -setallowpowerbuttontosleepcomputer on |
| -setdate mm:dd:yy | Use this command to set the current month, day, and year. Example:systemsetup -setdate 04:15:02 |
| -setlocalsubnetname name | Set Local Hostname to name. Example:systemsetup -setlocalsubnetname LabMac1 |
| -setnetworktimeserver timeserver | Use this command to designate a network time server. Enter the IP address or DNS name for the network time server. Example:systemsetup -setnetworktimeserver time.apple.com |
| -setremoteappleevents ( on | off ) | Use this command to set whether the server responds to events sent by other computers (such as AppleScripts). Example:systemsetup -setremoreappleevents on |
| -setremotelogin ( on | off ) | Sets remote login (SSH) to either on or off. Important If you turn off remote login, you won't be able to administer the server using SSH for remote login. Example:systemsetup -setremotelogin on |
| -setrestartfreeze ( on | off ) | Use this command to specify whether the server restarts automatically after the system freezes. Example:systemsetup -setrestartfreeze on |
| -setrestartpowerfailure ( on | off ) | Use this command to specify whether the server automatically restarts after a power failure. Example:systemsetup -setrestartpowerfailure on |
| -setsleep minutes | Sets amount of idle time until computer sleeps. Specify "Never" or "Off" for computers that should never sleep. IMPORTANT: if you set the system to sleep, you will not be able to administer the server remotely while it is sleeping. Example:systemsetup -setsleep 60 |
| -settime hh:mm:ss | Sets the current time. The provided time argument should be in 24-hour format. Example:systemsetup -settime 16:20:00 |
| -settimezone timezone | Use this command to set the local time zone. Use "-listtimezones" to list valid timezone arguments. Example:systemsetup -settimezone US/Pacific |
| -setusingnetworktime ( on | off ) | Sets whether using network time is on or off. Example:systemsetup -setusingnetworktime on |
| -setWaitForStartupAfterPowerFailure seconds | Set the number of seconds after which the computer will start up after a power failure. The <seconds> value must be a multiple of 30 seconds. Example:systemsetup -setWaitForStartupAfterPowerFailure 30 |
| -setwakeonmodem ( on | off ) | Use this command to specify whether or not the server will wake from sleep when modem activity is detected. Example:systemsetup -setwakeonmodem on |
| -setwakeonnetworkaccess ( on | off ) | Use this command to specify whether the server wakes from sleep when a network admin packet is sent to it. Example:systemsetup -setwakeonnetworkaccess on |
Any command in the Mac OS X Server command-line guide that uses systemsetup can be used in Remote Desktop using the Send UNIX Command task.
The command line guide can be found at: